<?php

namespace App\Services\Goods;

use App\Models\RuleModel;
use App\Services\BaseServices;

class RuleServices extends BaseServices
{
    /**
     * @param  int  $ruleId
     * @return \App\Models\BaseModel[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
     */
    public function getRuleListByRuleId(int $ruleId)
    {
        return RuleModel::query()->where('id', $ruleId)->get();
    }

    /**
     * @return RuleModel[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
     */
    public function getRuleList()
    {
        return RuleModel::query()->get();
    }

    /**
     * @param  array  $ruleIdArr
     * @return \App\Models\BaseModel[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
     */
    public function getRuleInId(array $ruleIdArr)
    {
        return RuleModel::query()->whereIn('id', $ruleIdArr)->get();
    }
}
